﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///Notice 的摘要说明
/// </summary>
public class CNotice
{
	public CNotice()
	{

	}

    public CNotice(int nid)
    {
        GetData gd = new GetData();
        notices n = gd.GetOnePostNotice(nid);
        if (n == null)
        {
            this.isExist = 0;
        }
        else 
        {
            this.nid = nid;
            this.toUid = n.toUid;
            this.fromUid = n.fromUid;
            this.messageSend = n.message;
            this.sendtime = n.sendtime;
            this.tid = n.tid;
            this.pid = n.pid;
            this.address = n.address;
            this.isReaded = n.isReaded;
            this.isExist = 1;
        }
    }


    public int nid;
    public int toUid;
    public int fromUid;
    public string messageSend;
    public DateTime sendtime;
    public int tid;
    public int pid;
    public int isReaded;
    public string address;
    public int isExist;

    public void SendNotice()
    {
        try
        {
            SaveData.NewNotice(this);
        }
        catch (System.Exception ex)
        {
        	
        }
    }

    public void MarkReaded()
    {
        try
        {
            SaveData.UpdateNotice(this);
        }
        catch (System.Exception ex)
        {
        	
        }
    }
}